<html>
<head>
<title>eLGU - Database Cleanup - {TITLE}</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style>
 A.x{text-decoration:none;}
 A:Hover{color:#ff0000;}
 .smallfont{font-family:arial; font-size:9px;}
 .mediumfont{font-family:arial; font-size:11px;}
</style>
<script language="Javascript">
function alertMerger(){
	var selectedOwners;
	selectedOwners = "";
	j=0;
	for(i=0 ; i<document.OwnerCompanyList.elements.length ; i++){
		if(document.OwnerCompanyList.elements[i].type=="checkbox"){
			if(document.OwnerCompanyList.elements[i].checked){
				selectedOwners += "    companyID:" + document.OwnerCompanyList.elements[i].value + "\n";
				j++;
			}
		}
	}
	if(selectedOwners!="" && j>1){
		if(confirm("This will assume that:\n"+selectedOwners+"refer to the same company.\nAre you sure you want to merge them into one identity?")){
			document.OwnerCompanyList.formAction.value = "merge";
			document.OwnerCompanyList.submit();
		}
	}
	return false;
}
</script>
</head>
<body BGCOLOR=#999999 link="#333333" vlink="#333333" alink="#333333" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<form name="OwnerCompanyList" action="MergeOwnerCompanyConfirm.php{Session}" method="post">
<input type="hidden" name="formAction">
<table width="100%" border="0" cellpadding="10" cellspacing="0" align=center>
<tr>
	<td valign=top align=left>
		&nbsp;
		&nbsp;
		<font face="arial" size=2 color="#ffffff">
			<b>{uname}</b> : {today}
		</font>
	</td>
	<td valign=top align=right>
		<font face="arial" size=2>
		&nbsp;
	    &nbsp;
		&nbsp;
	    &nbsp;
		<a href="../../Logout.php" class="x" title="Logout"><font color="#ffffff">Logout</font></a>
		</font>
	</td>
</tr>
<tr>
	<td colspan=2 bgcolor="#f6f6f6">
		<font face="arial" size=2>
		&nbsp;&nbsp;
		<a href="OwnerList.php{Session}" class="x"><b>Cleanup Owners</b></a> : 
		<a href="OwnerPersonList.php{Session}" class="x"><b>Persons</b></a>
		|
		<a href="OwnerCompanyList.php{Session}" class="x"><b><U>Companies</U></b></a>
		<br><br>
		&nbsp;&nbsp;
		Identify duplicate Companies and click "Merge Owners".
		</font>
	</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="10" cellspacing="0" align=center>
<tr>
	<td valign=top align=left>
     &nbsp;
	 <input type="button" value="MERGE OWNERS" onClick="alertMerger();"> 
	</td>
	<td align=right class="mediumfont">
	 <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page=1">FIRST</a> :: <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page={prev}">PREV</a> [ {page} of <B>{totalPages}</B> ] <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page={next}">NEXT</a> :: <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page={totalPages}">LAST</a>
	 &nbsp;&nbsp;
	</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="10" cellspacing="1" align=center>
<tr bgcolor="#cccccc">
	<td valign=top align=right class="smallfont">
	 companyID
	</td>
	<td valign=top align=left class="smallfont">
	 &nbsp;
	</td>
	<td class="smallfont" nowrap>
	 <a href="OwnerCompanyList.php{Session}&sortKey={sortKey}&sortOrder={oppositeSortOrder}&page={page}">companyName</a>
	 <img src="images/{oppositeSortOrder}_order.png">
	</td>
	<td class="smallfont">
	 address
	</td>
	<td class="smallfont">
	 tin
	</td>
	<td class="smallfont">
	 telephone
	</td>
	<td class="smallfont">
	 fax
	</td>
	<td class="smallfont">
	 website
	</td>
	<td class="smallfont">
	 email
	</td>
</tr>
<!-- BEGIN OwnerCompanyList -->
<tr bgcolor="#f6f6f6">
	<td class="smallfont" align=left>
	 {companyID}
	</td>
	<td align=center class="smallfont">
	 <input name="companyID[]" type="checkbox" value="{companyID}">
	</td>
	<td class="smallfont">
	 {companyName}
	</td class="smallfont">
	<td class="smallfont">
	 {address}
	</td>
	<td class="smallfont">
	 {tin}
	</td>
	<td class="smallfont">
	 {telephone}
	</td>
	<td class="smallfont">
	 {fax}
	</td>
	<td class="smallfont">
	 {website}
	</td>
	<td class="smallfont">
	 {email}
	</td>
</tr>
<!-- END OwnerCompanyList -->
</table>
<table width="100%" border="0" cellpadding="10" cellspacing="0" align=center>
<tr>
	<td valign=top align=left>
     &nbsp;
	 <input type="button" value="MERGE OWNERS" onClick="alertMerger();">	 
	</td>
	<td align=right class="mediumfont">
	 <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page=1">FIRST</a> :: <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page={prev}">PREV</a> [ {page} of <B>{totalPages}</B> ] <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page={next}">NEXT</a> :: <a href="OwnerCompanyList.php{Session}&sortKey=Company.companyName&sortOrder={sortOrder}&page={totalPages}">LAST</a>
	 &nbsp;&nbsp;
	</td>
</tr>
</table>
</form>
</body>
</html>